﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;

namespace ControllerClient
{
    class Sha1Hlper
    {

        public  static byte[] Sha(byte[] dataToHash)
        {
            SHA1 sha = new SHA1CryptoServiceProvider();

            //将mystr转换成byte[]
            //ASCIIEncoding enc = new ASCIIEncoding();
            //UTF8Encoding enc = new UTF8Encoding();
            //byte[] dataToHash = enc.GetBytes(data);

            //Hash运算
            byte[] dataHashed = sha.ComputeHash(dataToHash);

        

            return dataHashed;
        }
    }
}
